package com.gepengjun.lims.entity;

import com.baomidou.mybatisplus.enums.IdType;
import java.util.Date;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.enums.IdType;
import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableName;
import java.io.Serializable;

/**
 * <p>
 * 
 * </p>
 *
 * @author jun
 * @since 2018-09-07
 */
@TableName("sys_user")
public class User extends Model<User> {

    private static final long serialVersionUID = 1L;

    @TableId(value = "user_id", type = IdType.AUTO)
    private Long userId;
    private String username;
    @TableField("PASSWORD")
    private String password;
    private String salt;
    @TableField("STATUS")
    private Boolean status;
    @TableField("real_name")
    private String realName;
    private String telephone;
    private Date birthday;
    private Integer age;
    private Integer sex;
    @TableField("last_login_time")
    private Date lastLoginTime;
    @TableField("org_id")
    private Long orgId;
    @TableField("last_upd_user")
    private Long lastUpdUser;
    @TableField("last_upd_time")
    private Date lastUpdTime;
    private String remark;


    /**前台属性   begin*/
    @TableField(exist = false)
    private Orgnazation dept;

    @TableField(exist = false)
    private Orgnazation company;
    /**前台属性   end*/

    public Long getUserId() {
        return userId;
    }

    public User setUserId(Long userId) {
        this.userId = userId;
        return this;
    }

    public String getUsername() {
        return username;
    }

    public User setUsername(String username) {
        this.username = username;
        return this;
    }

    public String getPassword() {
        return password;
    }

    public User setPassword(String password) {
        this.password = password;
        return this;
    }

    public String getSalt() {
        return salt;
    }

    public User setSalt(String salt) {
        this.salt = salt;
        return this;
    }

    public Boolean getStatus() {
        return status;
    }

    public User setStatus(Boolean status) {
        this.status = status;
        return this;
    }

    public String getRealName() {
        return realName;
    }

    public User setRealName(String realName) {
        this.realName = realName;
        return this;
    }

    public String getTelephone() {
        return telephone;
    }

    public User setTelephone(String telephone) {
        this.telephone = telephone;
        return this;
    }

    public Date getBirthday() {
        return birthday;
    }

    public User setBirthday(Date birthday) {
        this.birthday = birthday;
        return this;
    }

    public Integer getAge() {
        return age;
    }

    public User setAge(Integer age) {
        this.age = age;
        return this;
    }

    public Integer getSex() {
        return sex;
    }

    public User setSex(Integer sex) {
        this.sex = sex;
        return this;
    }

    public Date getLastLoginTime() {
        return lastLoginTime;
    }

    public User setLastLoginTime(Date lastLoginTime) {
        this.lastLoginTime = lastLoginTime;
        return this;
    }

    public Long getOrgId() {
        return orgId;
    }

    public User setOrgId(Long orgId) {
        this.orgId = orgId;
        return this;
    }

    public Long getLastUpdUser() {
        return lastUpdUser;
    }

    public User setLastUpdUser(Long lastUpdUser) {
        this.lastUpdUser = lastUpdUser;
        return this;
    }

    public Date getLastUpdTime() {
        return lastUpdTime;
    }

    public User setLastUpdTime(Date lastUpdTime) {
        this.lastUpdTime = lastUpdTime;
        return this;
    }

    public String getRemark() {
        return remark;
    }

    public User setRemark(String remark) {
        this.remark = remark;
        return this;
    }

    public String getCreditialsSalt(){
        return this.username+this.salt;
    }

    public Orgnazation getDept() {
        return dept;
    }

    public void setDept(Orgnazation dept) {
        this.dept = dept;
    }

    public Orgnazation getCompany() {
        return company;
    }

    public void setCompany(Orgnazation company) {
        this.company = company;
    }

    @Override
    protected Serializable pkVal() {
        return this.userId;
    }

    @Override
    public String toString() {
        return "User{" +
                "userId=" + userId +
                ", username='" + username + '\'' +
                ", password='" + password + '\'' +
                ", salt='" + salt + '\'' +
                ", status=" + status +
                ", realName='" + realName + '\'' +
                ", telephone='" + telephone + '\'' +
                ", birthday=" + birthday +
                ", age=" + age +
                ", sex=" + sex +
                ", lastLoginTime=" + lastLoginTime +
                ", orgId=" + orgId +
                ", lastUpdUser=" + lastUpdUser +
                ", lastUpdTime=" + lastUpdTime +
                ", remark='" + remark + '\'' +
                '}';
    }
}
